<?php
/**
 * ErrorCallerException
 * 
 * @category	Exception
 * @package		dayscript.exception
 * @subpackage	
 * @author		Nelson Daza <ndaza@dayscript.com>
 * @copyright	2009 Dayscript Ltda.
 * @license		
 * @version		1.0
 * @version		$Revision: 0 $
 * @filesource	
 * @link		http://www.dayscript.com
 * @link		{docsLink}
 * @uses		
 * @since		1.0
 * @modifiedby	$LastChangedBy: Nelson Daza $
 * @modified	$Date: 2009-08-13 $
 */

namespace dayscript\exception;

/**
 * ErrorCallerException
 * 
 * Error Caller Exception
 * 
 * @category	Exception
 * @package		dayscript.exception
 * @subpackage	
 * @author		Nelson Daza <ndaza@dayscript.com>
 * @copyright	2009 Dayscript Ltda.
 * @license		
 * @version		1.0
 * @link		http://www.dayscript.com
 * @link		{docsLink}
 * @uses		\dayscript\exception\ErrorException, \dayscript\ErrorManager
 * @since		1.0
 * @modifiedby	$LastChangedBy: Nelson Daza $
 * @modified	$Date: 2009-08-13 $
 */
class ErrorCallerException extends \dayscript\exception\ErrorException {
	/**
	 * ErrorCallerException Contructor
	 * @param string $message
	 * @param int $code
	 * @param int $severity
	 * @param string $file
	 * @param int $line
	 * @return \dayscript\exception\ErrorCallerException
	 */
	public function __construct( $message = null, $code = \E_UNKNOWN, $severity = 0 )	{
		$stack = \dayscript\ErrorManager::getBacktrace( 1, 1 );
		$file = $line = null;
		if( \count( $stack ) > 0 )	{
			$file = $stack[0]['file'];
			$line = $stack[0]['line'];
		}
		parent::__construct( $message, $code, $severity, $file, $line );
	}
}
